#!perl

use  strict;
use Data::Dumper;
use Algorithm::NaiveBayes;

my $nb = Algorithm::NaiveBayes->new (purge =>1);

$nb->add_instance(attributes => {ballon => 1, public => 1,  joueur => 1},  label => 'sports');

$nb->add_instance
(attributes => {lens => 1, ballon => 1},
 label => 'sports');

$nb->add_instance
(attributes => {ballon => 1, om => 1},
 label => ['sports', 'finance']);

$nb->add_instance
(attributes => {ballon => 6, psg => 4},
 label => ['sports', 'finance']);

#... repeat for several more instances, then:
$nb->train;

# Find results for unseen instances
my $result = $nb->predict
(attributes => {lens => 3, psg =>3,  ballon=>2, public =>9, joueur =>11});

print Dumper $result;
